package com.javafactroy.kunlong.test.hutool;

import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.javafactroy.kunlong.DbAgent;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.TestMethodOrder;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit.jupiter.SpringExtension;

import java.util.Date;

/**
 * @author raymond.lei@163.com
 * @date 2023-10-29 12:29:16
 */

@SpringBootTest(classes = {DbAgent.class}, webEnvironment = SpringBootTest.WebEnvironment.NONE)
@ExtendWith(SpringExtension.class)
@Slf4j
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
@TestMethodOrder(MethodOrderer.MethodName.class)
public class TestHutool {


    @Test
    public void test001_dateutil() {
        Date date = DateUtil.parseDateTime("2021-01-01 00:00:00");
        log.info("date = {}", date);
    }

    @Test
    public void test002_objutil() {
        Date date = DateUtil.parseDateTime("2021-01-01 00:00:00");
        log.info("date  = {} not empty = {}", date, ObjectUtil.isNotEmpty(date));
    }



}

